OUTPUT TO c:\qadguicli\wafx.xls.

FOR EACH wo_mstr NO-LOCK WHERE wo_nbr MATCHES("WA*FX*"),
    EACH wod_det NO-LOCK WHERE wod_nbr = wo_nbr AND wod_part BEGINS "P"
    BREAK BY wo_nbr :

    IF FIRST-OF (wo_nbr) THEN DO:
        ACCUMULATE wo_qty_ord (TOTAL BY wo_nbr).
        ACCUMULATE (wo_qty_comp + wo_qty_rjct) (TOTAL BY wo_nbr).
        
    END.
    ACCUMULATE (wod_qty_iss - wod_qty_ret) (TOTAL BY wo_nbr).    
    ACCUMULATE (wod_qty_iss - wod_qty_ret) (TOTAL).
    DISP wo_nbr wo_part wo_rel_date 
         wo_qty_ord WHEN FIRST-OF (wo_nbr)
         wo_qty_comp WHEN FIRST-OF (wo_nbr)
         ACCUM TOTAL wo_qty_ord WHEN FIRST-OF (wo_nbr)
         ACCUM TOTAL (wo_qty_comp + wo_qty_rjct) WHEN FIRST-OF (wo_nbr)
         wod_part 
         ACCUM TOTAL (wod_qty_iss - wod_qty_ret)
         ACCUM TOTAL BY wo_nbr (wod_qty_iss - wod_qty_ret)
         wod_qty_iss wod_qty_ret
         
        
        WITH STREAM-IO WIDTH 320 .


END.
